package com.mp.approvalreq.entity.dto;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * Created by liuqi on 2018/7/24.
 */
public class GeneralConditionFlowDTO {
	
	private Integer id;
	
	/**
	 *  通用审批流id
	 */
	private Integer generalFlowId;
	
	private Integer companyId;
	
	/**
	 * 条件类型 1:金额，2:时长
	 */
	private Integer conditionType;
	/**
	 * 条件计算类型：1：比较，2：在某某范围内
	 */
	private Integer conditionCalculationType;
	/**
	 * 比较条件下的最小因子
	 */
	private BigDecimal smallerFactor;
	/**
	 * 比较条件下的最大因子
	 */
	private BigDecimal greaterFactor;
	/**
	 * 范围条件下的范围，数据以xx,xx,xx保存
	 */
	private String range;
	/**
	 * 审批流，xx,xx,xx
	 */
	private String requestFlow;
	/**
	 * 是否支持灵活审批,0不1是
	 */
	private int isAllowedToEditJudger;
	
	public GeneralConditionFlowDTO() {
	}
	
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public Integer getGeneralFlowId() {
		return generalFlowId;
	}
	
	public void setGeneralFlowId(Integer generalFlowId) {
		this.generalFlowId = generalFlowId;
	}
	
	public Integer getCompanyId() {
		return companyId;
	}
	
	public void setCompanyId(Integer companyId) {
		this.companyId = companyId;
	}
	
	public Integer getConditionType() {
		return conditionType;
	}
	
	public void setConditionType(Integer conditionType) {
		this.conditionType = conditionType;
	}
	
	public Integer getConditionCalculationType() {
		return conditionCalculationType;
	}
	
	public void setConditionCalculationType(Integer conditionCalculationType) {
		this.conditionCalculationType = conditionCalculationType;
	}
	
	public BigDecimal getSmallerFactor() {
		return smallerFactor;
	}
	
	public void setSmallerFactor(BigDecimal smallerFactor) {
		this.smallerFactor = smallerFactor;
	}
	
	public BigDecimal getGreaterFactor() {
		return greaterFactor;
	}
	
	public void setGreaterFactor(BigDecimal greaterFactor) {
		this.greaterFactor = greaterFactor;
	}
	
	public String getRange() {
		return range;
	}
	
	public void setRange(String range) {
		this.range = range;
	}
	
	public String getRequestFlow() {
		return requestFlow;
	}
	
	public void setRequestFlow(String requestFlow) {
		this.requestFlow = requestFlow;
	}
	
	public int getIsAllowedToEditJudger() {
		return isAllowedToEditJudger;
	}
	
	public void setIsAllowedToEditJudger(int isAllowedToEditJudger) {
		this.isAllowedToEditJudger = isAllowedToEditJudger;
	}
	
	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		GeneralConditionFlowDTO that = (GeneralConditionFlowDTO) o;
		return isAllowedToEditJudger == that.isAllowedToEditJudger &&
				Objects.equals(id, that.id) &&
				Objects.equals(generalFlowId, that.generalFlowId) &&
				Objects.equals(companyId, that.companyId) &&
				Objects.equals(conditionType, that.conditionType) &&
				Objects.equals(conditionCalculationType, that.conditionCalculationType) &&
				Objects.equals(smallerFactor, that.smallerFactor) &&
				Objects.equals(greaterFactor, that.greaterFactor) &&
				Objects.equals(range, that.range) &&
				Objects.equals(requestFlow, that.requestFlow);
	}
	
	@Override
	public int hashCode() {
		return Objects.hash(id, generalFlowId, companyId, conditionType, conditionCalculationType, smallerFactor, greaterFactor, range, requestFlow, isAllowedToEditJudger);
	}
	
	@Override
	public String toString() {
		return "GeneralConditionFlowDTO{" +
				"id=" + id +
				", generalFlowId=" + generalFlowId +
				", companyId=" + companyId +
				", conditionType=" + conditionType +
				", conditionCalculationType=" + conditionCalculationType +
				", smallerFactor=" + smallerFactor +
				", greaterFactor=" + greaterFactor +
				", range='" + range + '\'' +
				", requestFlow='" + requestFlow + '\'' +
				", isAllowedToEditJudger=" + isAllowedToEditJudger +
				'}';
	}
}
